#ifndef _common_h
#define _common_h

#include <stdio.h>

#include "n32g430.h"


//ϵͳʱ��
#define SYSCLK_USE_HSIDIV2_PLL 0
#define SYSCLK_USE_HSEDIV2_PLL 1
#define HSE_Value   (8000000)

#define SYSCLK_SOURCE_HSI 1
#define SYSCLK_SOURCE_HSE 2
#define SYSCLK_SOURCE_HSI_PLL 3
#define SYSCLK_SOURCE_HSE_PLL 4


// printf ��������
#define USARTx              USART1
#define USARTx_CLK          RCC_APB2_PERIPH_USART1
#define USARTx_GPIO         GPIOA
#define USARTx_GPIO_CLK     RCC_AHB_PERIPH_GPIOA
#define USARTx_RxPin        GPIO_PIN_10
#define USARTx_TxPin        GPIO_PIN_9
#define USARTx_Rx_GPIO_AF   GPIO_AF5_USART1
#define USARTx_Tx_GPIO_AF   GPIO_AF5_USART1
#define GPIO_AHBClkCmd      RCC_AHB_Peripheral_Clock_Enable
#define USART_APBxClkCmd    RCC_APB2_Peripheral_Clock_Enable


void DPM_BoardInit(void);
void DPM_SysTimeRecord(uint16_t x_ms);
uint32_t DPM_ReadSysTime_Ms(void);


#endif

